package com.caregiver.watch.business.user.model.vo;

import com.caregiver.watch.business.user.model.po.UserHealthGoal;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Objects;

/**
 * @Description: 用户健康目标信息
 * @program: caregiver-watch
 * @author: 疆戟
 * @create: 2025-10-03 23:09
 */
@Data
@Schema(description = "用户健康目标信息")
public class UserHealthGoalVo {

    // 用户健康目标ID
    @Schema(description = "用户健康目标ID")
    private Long userHealthGoalId;
    // 每日活动消耗
    @Schema(description = "每日活动消耗(卡路里/天)")
    private Integer dailyActivityConsumption;
    // 每日活动时长
    @Schema(description = "每日活动时长(分钟/天)")
    private Integer dailyActivityDuration;
    // 每日站立次数
    @Schema(description = "每日站立次数")
    private Integer dailyStandingCount;
    // 每日步数
    @Schema(description = "每日步数")
    private Integer dailySteps;
    // 睡眠时长（小时）
    @Schema(description = "睡眠时长(小时)")
    private Integer sleepDurationHour;
    // 睡眠时长（分钟）
    @Schema(description = "睡眠时长(分钟)")
    private Integer sleepDurationMinute;


    public static UserHealthGoalVo build(UserHealthGoal po) {
        if (Objects.isNull(po)) {
            return null;
        }
        UserHealthGoalVo userHealthGoalVo = new UserHealthGoalVo();
        userHealthGoalVo.setDailyActivityConsumption(po.getDailyActivityConsumption());
        userHealthGoalVo.setDailyActivityDuration(po.getDailyActivityDuration());
        userHealthGoalVo.setDailyStandingCount(po.getDailyStandingTime());
        userHealthGoalVo.setDailySteps(po.getDailySteps());
        userHealthGoalVo.setSleepDurationHour(po.getSleepDurationHour());
        userHealthGoalVo.setSleepDurationMinute(po.getSleepDurationMinute());
        return userHealthGoalVo;
    }
}
